
function settin(n){

  tli=document.getElementById('tits').getElementsByTagName("li");
   
  for(i=0;i<tli.length;i++){
	  
    k=i+1
    if (k==n){
      tli[i].className="cur";
      document.getElementById('con_'+k).style.display="";
    }else{
      tli[i].className="";
      document.getElementById('con_'+k).style.display="none";
    }
  }
}

//查看更多作品
$('#pa').live("click",function () {
   var url=$(this).attr("href");
   
   //alert(url)
     $.ajax({
        type:"GET",
        url: url,
        //data: "name=John&location=Boston",
		dataType:'json', //数据类型
        success: function(msg){
			
			if(msg!=1){
			var result_len=msg.data_case.length;
			//alert(result_len)
			for(var i=0;i<result_len;i++){
		     var unixTimestamp = new Date(msg.data_case[i].createtime * 1000) ;
             var commonTime = unixTimestamp.toLocaleDateString()
			 
			var html='';
			 html+=' <div class="bd">';
             html+=' <li><a href="index.php?g=Home&m=Case&a=show&id='+msg.data_case[i].id+'"><img class="bdimg" src="'+msg.data_case[i].thumb_list+'" alt="" /></a></li>';
                
             html+=' <li class="des_info">';
             html+=' <p class="title_sjs"><a href="index.php?m=Case&a=show&id='+msg.data_case[i].id+'">'+msg.data_case[i].title+'</a></p>';
             html+=' <p class="title_sjs1">'+msg.data_case[i].describe+'</p>';
             html+=' <div class="tab">';
             html+=' <table>';
             html+=' <tbody>';
             html+=' <td>类型： '+msg.data_case[i].itemType+'</td>';
             html+=' <td>风格：'+msg.data_case[i].style+'</td></tbody>';
             html+=' <tbody>';
             html+=' <td>面积：'+msg.data_case[i].itemArea+'㎡</td>';
             html+=' <td>造价：'+msg.data_case[i].budget+'元</td>';
             html+=' </tbody>';
             html+=' <tbody>';
             html+=' <td>发布时间：'+commonTime+'</td>';
             html+=' <td></td>';
             html+=' </tbody>';
             html+=' </table>';
             html+=' </div>';
             html+='  <p ><a style="color:#f5af58; font-size:14px" href="index.php?m=Case&a=show&id='+msg.data_case[i].id+'">查看详情</a></p>';
             html+='   </li>';
             html+=' </div>'
			 $("#con_1").append(html);
			}
			
			
			
			 var url_t=' <div id="genduo" style=" text-align:center; "><a id="pa" style="font-size:18px;color:#f5af58;" href="index.php?m=User&a=index&id='+msg.id+'&p='+msg.p+'" ">查看更多</a></div>' 
			
			
			}else{ var url_t=' <div id="genduo" style=" text-align:center;font-size:18px;color:#f5af58; ">没有了</div>'    }
			 $("#genduo").remove();
		  $("#con_1").append(url_t);
	 }
   
    		
});
   

 return false;//阻止刷新
  });

//查看更多收藏
$('#keep_cha').live("click",function () {
   var url=$(this).attr("href");
   
   //alert(url)
     $.ajax({
        type:"GET",
        url: url,
        //data: "name=John&location=Boston",
		dataType:'json', //数据类型
        success: function(msg){
			if(msg!=1){
			var result_len=msg.data_keep.length;
			//alert(result_len)
			for(var i=0;i<result_len;i++){
		     var unixTimestamp = new Date(msg.data_keep[i].createtime * 1000) ;
             var commonTime = unixTimestamp.toLocaleDateString()
			 
			 
			 
			var html='';
		        html+='<ul>';
                html+='<li>';
				if(msg.data_keep[i].module=='Zforum_theme'){
					var url=msg.data_keep[i].url.split('m=')[1];
					html+='<a href="index.php?m='+url+'" >'+msg.data_keep[i].title+'</a>';
					 }else{
                html+='<a href="index.php?m='+msg.data_keep[i].module+'&a=show&id='+msg.data_keep[i].id+'">'+msg.data_keep[i].title+'</a>';}
                html+='</li>';
                html+='<li></li>';
                html+='<li></li>';
                html+='<li>'+commonTime+'</li>';
                html+='</ul>';
  
			 $("#con_3 .tiezi").append(html);
			}
			
			
			
			 var url_t=' <div  id="keep_k" style=" text-align:center; "><a id="keep_cha" style="font-size:18px;color:#f5af58;" href="index.php?m=User&a=keep&id='+msg.id+'&p='+msg.p+'" ">查看更多</a></div>' 
			
			
			}else{ var url_t=' <div id="keep_k" style=" text-align:center;font-size:18px;color:#f5af58; ">没有了</div>'    }
			 $("#keep_k").remove();
		     $("#con_3 ").append(url_t);
	 }
   
    		
});
   

 return false;//阻止刷新
  });
  
  //查看更多评论
  $('#comment_cha').live("click",function () {
   var url=$(this).attr("href");
   
   //alert(url)
     $.ajax({
        type:"GET",
        url: url,
        //data: "name=John&location=Boston",
		dataType:'json', //数据类型
        success: function(msg){
			if(msg!=1){
			var result_len=msg.data_comment.length;
			//alert(result_len)
			for(var i=0;i<result_len;i++){
		     var unixTimestamp = new Date(msg.data_comment[i].createtime * 1000) ;
             var commonTime = unixTimestamp.toLocaleDateString()
			 
			var html='';
		        html+='<ul class="wind_xgtnyUL3"> <li>';
                html+='<img class="wind_header" src="'+msg.data_comment[i].avatar+'" />';
                html+='</li>';
                html+='<li style="width:600px; margin-left:20px;">';
                html+='<ul class="wind_xgtnyUL4" >';
                html+='<li style="width:100%;">';
                html+='<span style="font-size:18px;line-height:42px;">'+msg.data_comment[i].username+'&nbsp;&nbsp;</span>';
                html+='<span style="color:#999;">'+commonTime+'说：</span>';
                html+='</li>';
                html+='<p>'+msg.data_comment[i].content+'</p>';
                html+='</ul></li><div style="clear:both;"></div></ul>';
  
			 $("#comm").append(html);
			}
			 var url_t=' <div  id="comment_g" style=" text-align:center; "><a id="comment_cha" style="font-size:18px;color:#f5af58;" href="index.php?m=User&a=comment&id='+msg.id+'&p='+msg.p+'" ">查看更多</a></div>' 
			}else{ var url_t=' <div id="comment_g" style=" text-align:center;font-size:18px;color:#f5af58; ">没有了</div>'    }
		   $("#comment_g").remove();
		   $("#comm").append(url_t);
	 }
   
    		
});
   

 return false;//阻止刷新
  });



//查看更多帖子
  $('#theme_cha').live("click",function () {
     var url=$(this).attr("href");
	 var url_t='';
   
   //alert(url)
     $.ajax({
        type:"GET",
        url: url,
        //data: "name=John&location=Boston",
		dataType:'json', //数据类型
        success: function(msg){
		
			if(msg!=1){
			var result_len=msg.list_theme.length;
			//alert(result_len)
			for(var i=0;i<result_len;i++){
		        commonTime=getLocalTime(msg.list_theme[i].createtime);
				url='index.php?g=Home&m=Zforum_reply&a=index&id='+msg.list_theme[i].id+'&plateid='+msg.list_theme[i].plate;
			 
			var html='';
		        html+='<ul>';
                html+='<li style="width:45%">';
                html+='<a href="'+url+'" target="_blank">'+msg.list_theme[i].title+'</a>';
                html+='</li>';
                html+='<li style="width:15%"><img src="/JGsat/Tpl/Home/Default/Public/images/order6.png" />&nbsp;&nbsp;&nbsp;'+msg.list_theme[i].reply_num+'</li>';
                html+='<li style="width:15%"><img src="/JGsat/Tpl/Home/Default/Public/images/windimg44.png" />&nbsp;&nbsp;&nbsp;'+msg.list_theme[i].hits+'</li>';
                html+='<li style=" text-align:right">'+commonTime+'</li>';
                html+='</ul>';
               //alert(html)
			 $(".themeajax .tiezi").append(html);
			}
			 url_t=' <div  id="keep_g" style=" text-align:center; "><a id="theme_cha" style="font-size:18px;color:#f5af58;" href="index.php?m=User&a=keep&id='+msg.id+'&p='+msg.p+'" ">查看更多</a></div>' 
			
			}else{ url_t=' <div id="keep_g" style=" text-align:center;font-size:18px;color:#f5af58; ">没有了</div>'  }
			
			 $("#keep_g").remove();
		     $(".themeajax ").append(url_t);
			
	 }
   
    		
});
   

 return false;//阻止刷新
  });
  
  function getLocalTime(nS) {   
	   var　d=new Date(parseInt(nS) * 1000).toLocaleString();
       return d.replace('/', "-").replace('/', "-").replace('上午', "").replace('下午', "");      
    }     